package com.mzj.saas.jobs.report.executor;


import com.mzj.saas.jobs.report.entity.ReportRepairStatistics;
import com.mzj.saas.jobs.report.service.ReportRepairStatisticsService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 报修报事统计
 */
@JobHandler(value ="reportRepairStatisticsExecutor")
@Component
public class ReportRepairStatisticsExecutor extends IJobHandler {

    private static Logger log = LoggerFactory.getLogger(ReportRepairStatisticsExecutor.class);

    @Autowired
    private ReportRepairStatisticsService reportRepairStatisticsService;

    public ReturnT<String> execute(String arg0) throws Exception {
        long time = System.currentTimeMillis();

        String result = reportRepairStatisticsService.work();

        long useTime = System.currentTimeMillis() - time;
        log.info("----> reportRepairStatisticsExecutor end, result: {}, use time: {}", result, useTime);

        return SUCCESS;
    }


}
